package com.ljf.tijian.controller;

import com.ljf.tijian.dto.ApiResponse;
import com.ljf.tijian.dto.CheckmealDetailedDto;
import com.ljf.tijian.pojo.Orders;
import com.ljf.tijian.pojo.Overallresult;
import com.ljf.tijian.service.CiReportService;
import com.ljf.tijian.service.OverallResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ReportController {

    @Autowired
    CiReportService ciReportService;

    @Autowired
    OverallResultService overallResultService;


    @RequestMapping("/createReportTemplate")
    public ApiResponse createReportTemplate(@RequestBody Orders orders){
        System.out.println("进入报告创建");
        return  ciReportService.createTemplate(orders);
    }

    @RequestMapping("/getoverallresult")
    public ApiResponse getoverallresult(@RequestBody Overallresult overallresult){
        return overallResultService.getOverallResultData(overallresult.getOrderId());
    }

    @RequestMapping("/updateoverallresult")
    public ApiResponse updateoverallresult(@RequestBody Overallresult overallresult){
        System.out.println("进入结论更新");
        return overallResultService.updateOverallResultData(overallresult);
    }

    @RequestMapping("/deleteoverallresult")
    public ApiResponse deleteoverallresult(@RequestBody Overallresult overallresult){
        System.out.println("进入结论删除");
        return overallResultService.deleteOverallResultData(overallresult.getOrId());
    }

    @RequestMapping("/addoverallresult")
    public ApiResponse addoverallresult(@RequestBody Overallresult overallresult){
        System.out.println("进入结论添加");
        return overallResultService.addOverallResultData(overallresult);
    }

}
